Skip to content

Backport test fixes to 4.0.x#3005

Merged
soutaro merged 4 commits into
aaa-4.0.xfrom
backport-4.0.x-2981-3004
Jun 18, 2026
Merged

Backport test fixes to 4.0.x#3005
soutaro merged 4 commits into
aaa-4.0.xfrom
backport-4.0.x-2981-3004

Conversation

@soutaro

@soutaro soutaro commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Backport test fixes needed for the 4.0.x release branch.

Original PRs:

Changes

  • Open compressed test fixtures in binary mode for Zlib::GzipReader.wrap.
  • Make DirSingletonTest#test_fchdir and DirSingletonTest#test_for_fd robust against aggressive GC.

Testing

Not run locally. This will be tested in CI.

nobu and others added 3 commits June 18, 2026 14:26
The Dir created by `Dir.new(Dir.pwd).fileno` was only referenced long
enough to read its fileno, so it became collectable immediately. When
GC ran between the assert_send_type calls the fd was closed, making the
later `Dir.fchdir(fd)` fail with Errno::EBADF. Keep the Dir in a local
and close it in ensure. Surfaced on ruby/ruby ZJIT CI with
--enable-zjit=dev --zjit-call-threshold=1.

https://github.com/ruby/ruby/actions/runs/27735384476/job/82051097840

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
test_for_fd has the same pattern as test_fchdir: the Dir from
`Dir.new(Dir.pwd).fileno` is collectable before `Dir.for_fd(fd)` runs,
so an ill-timed GC closes the fd and the call fails with Errno::EBADF.
Keep the Dir alive in a local and close it in ensure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@soutaro soutaro added this to the RBS 4.0.x milestone Jun 18, 2026
Released bundlers (up to 4.0.11) reference Pathname::SEPARATOR_PAT,
which became a private constant on ruby-head, causing bundle install
to crash with NameError. The fix (ruby/rubygems#9529) is on master
but not yet released.

Use bundler's "version system" config to skip the lockfile-pinned
4.0.1 and use ruby-head's bundled bundler instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@soutaro soutaro merged commit f93b6b8 into aaa-4.0.x Jun 18, 2026
21 of 22 checks passed
@soutaro soutaro deleted the backport-4.0.x-2981-3004 branch June 18, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants